//
//  NMyWalletPsdSetController.m
//  News
//
//  Created by zhangtao on 2018/10/29.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "NMyWalletPsdSetController.h"
#import "TPPasswordTextView.h"
#import "NMyWalleetPsdSetLastController.h"
@interface NMyWalletPsdSetController ()

@end

@implementation NMyWalletPsdSetController

-(void)rightClick{
    NMyWalleetPsdSetLastController *last = [[NMyWalleetPsdSetLastController alloc]init];
    [self.navigationController pushViewController:last animated:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"设置钱包密码";
    self.view.backgroundColor = MAIN_BG_COLOR;//RGB(245, 245, 245, 1);
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"下一步" style:UIBarButtonItemStyleDone target:self action:@selector(rightClick)];
    [self.navigationItem.rightBarButtonItem setTintColor:MAIN_COLOR];
    [self createUI];
}


-(void)createUI{
    UILabel *lab1 = [[UILabel alloc]initWithFrame:CGRectMake(0, navHeight+30, ACEWidth, 20)];
    lab1.font = MIN_FONT;
    lab1.textColor = [UIColor lightGrayColor];
    lab1.textAlignment = NSTextAlignmentCenter;
    lab1.text = @"设置钱包密码需要先验证绑定手机";
    [self.view addSubview:lab1];
    
    UILabel *lab2 = [[UILabel alloc]initWithFrame:CGRectMake(50, CGRectGetMaxY(lab1.frame)+20, ACEWidth-100, 80)];
    lab2.numberOfLines = 2;
    NSMutableAttributedString *textStr = [[NSMutableAttributedString alloc] initWithString:@"请输入绑定手机138****7799\n收到的6位数字验证码"];
    lab2.textAlignment = NSTextAlignmentCenter;
        [textStr addAttribute:NSForegroundColorAttributeName value:MAIN_COLOR range:NSMakeRange(22, 7)];//从0位置开始的长度为2的红色
    [lab2 setAttributedText: textStr];
    [self.view addSubview:lab2];
    
    TPPasswordTextView *codeView = [[TPPasswordTextView alloc]initWithFrame:CGRectMake(50, CGRectGetMaxY(lab2.frame)+20, ACEWidth-100, 35)];
    codeView.elementCount = 6;
    codeView.backgroundColor = [UIColor clearColor];
//    view4.center = CGPointMake(center.x, 200);
    codeView.elementBorderColor = RGB(235, 235, 235, 1);//[UIColor lightGrayColor];
    codeView.elementMargin = 10;
    [self.view addSubview:codeView];
    codeView.passwordDidChangeBlock = ^(NSString *password) {
        NSLog(@"%@",password);
    };
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
